#ifndef DATEPACKERDIALOG_H
#define DATEPACKERDIALOG_H

#include <time.h>
#include "YesNoPortrol.h"

class DatePackerStep;

class DatePackerDialog : public YesNoPortrol
{
public:
	/* 日期结构 */
	struct date_t{
	        u_int16_t 		y;
	        u_int8_t 		m;
	        u_int8_t 		d;
	};
	static int convertCTimeToDate(time_t time, DatePackerDialog::date_t* out);
public:
					DatePackerDialog();
					~DatePackerDialog();
					CREATE_FUNC(DatePackerDialog)
public:
	bool				init();
	const size_t			getRetCode();
private:
	void				updateDayFromYear();
	void				updateDayFromMon();

private:
	enum {
		DATE_PACKER_YEAR = 0,
		DATE_PACKER_MON,
		DATE_PACKER_DAY,
		DATE_PACKER_CNT
	};
	date_t				_date;
	DatePackerStep*			_packer[DATE_PACKER_CNT];
};

#endif // DATEPACKERDIALOG_H
